package org.minos.edit.controller
{
	import flash.filesystem.File;
	import flash.net.FileFilter;
	import org.minos.edit.controller.manager.FileManager;
	import org.minos.edit.EditFacate;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	/**
	 * ...
	 * @author Minos
	 */
	public class OpenFileCommand extends SimpleCommand
	{
		
		override public function execute( notification : INotification ) : void
		{
			super.execute( notification );
			
			FileManager.browseForOpen( "open" , callback , "打开" , [ new FileFilter( "XML" , "*.xml" ) ] );
			function callback( o : Object = null ) : void
			{
				FileManager.setCurrentFile( FileManager.getFile( "open" ) );
				sendNotification( EditFacate.READ_FILE , FileManager.getCurrentFile() );
			}
		
		}
	
	}

}